package dav.mobile.garuda.components;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

import dav.mobile.garuda.states.game.objects.encounters.Encounter;

public class ResourceManager {
	//Font
	public static BitmapFont m_FontScene;
	public static BitmapFont m_FontClear;
	public static BitmapFont m_FontFailed;
	public static BitmapFont m_FontScore;
	public static BitmapFont m_FontScorePlay;
	
	//Splash Resource
	public static TextureRegion m_Splash;
	
	//Menu Resource
	public static TextureRegion m_MenuBackground;
	public static TextureRegion m_MenuTitle;
	public static TextureRegion m_MenuPlay;
	public static TextureRegion m_MenuPlayPressed;
	public static TextureRegion m_MenuFreePlay;
	public static TextureRegion m_MenuFreePlayPressed;
	public static TextureRegion m_MenuCredits;
	public static TextureRegion m_MenuCreditsPressed;
	public static TextureRegion m_MenuSound;
	public static TextureRegion m_MenuSoundPressed;
	
	//Map Resource
	public static TextureRegion	m_MapBackground;
	public static TextureRegion m_Sulawesi;
	public static TextureRegion m_SulawesiInfo;
	public static TextureRegion m_SulawesiButton;
	public static TextureRegion m_Jawa;
	public static TextureRegion m_JawaInfo;
	public static TextureRegion m_JawaButton;
	public static TextureRegion m_Sumatera;
	public static TextureRegion m_SumateraInfo;
	public static TextureRegion m_SumateraButton;
	public static TextureRegion m_Kalimantan;
	public static TextureRegion m_KalimantanInfo;
	public static TextureRegion m_KalimantanButton;
	
	//Scene Resource
	public static TextureRegion 	vn_Textbox;
	public static TextureRegion 	vn_AiraBiasa;
	public static TextureRegion 	vn_AiraSedih;
	public static TextureRegion 	vn_AiraSenang;
	public static TextureRegion 	vn_Ambordeva;
	public static TextureRegion 	vn_AyahGaruda;
	public static TextureRegion 	vn_DayangSumbiBiasa;
	public static TextureRegion 	vn_Gardana;
	public static TextureRegion 	vn_GarudaBiasa;
	public static TextureRegion 	vn_GarudaBingung;
	public static TextureRegion 	vn_GarudaSedih;
	public static TextureRegion 	vn_GarudaSenang;
	public static TextureRegion 	vn_GatotKacaBiasa;
	public static TextureRegion 	vn_GatotKacaSenang;
	public static TextureRegion 	vn_HanomanBiasa;
	public static TextureRegion 	vn_HanomanSenang;
	public static TextureRegion 	vn_Petapa;
	public static TextureRegion 	vn_ShintaBiasa;
	public static TextureRegion 	vn_Srikandi;
	public static TextureRegion[]	vn_Backgrounds;
	
	//Game Resource
	public static TextureRegion[] 	m_GameBackgrounds;
	public static TextureRegion[] 	m_GameBackgroundFloors;
	
	public static TextureRegion		m_GameWindButton;
	public static TextureRegion		m_GameGatotkacaButton;
	public static TextureRegion		m_GameWandButton;
	public static TextureRegion		m_GameWarpButton;
	
	public static TextureRegion 	m_AiraSprite;
	public static TextureRegion		m_ButoSprite; //Bali
	public static TextureRegion		m_GardanaSprite; //Bali
	public static TextureRegion		m_GardapatiSprite; //Bali
	public static TextureRegion		m_GatotKacaSprite; //Toba
	public static TextureRegion		m_GaluvastraSprite; //Prambanan
	public static TextureRegion		m_HanomanSprite; //Borneo
	public static TextureRegion		m_3DewiSprite; //Bunaken
	
	public static TextureRegion[]	m_LumpingSprite;
	public static TextureRegion[]	m_LandakSprite;
	public static TextureRegion[]	m_StupaSprite;
	public static TextureRegion[][]	m_BungaSprite;
	public static TextureRegion[][]	m_BurungSprite;
	public static Animation[]		m_BungaAnimation;
	public static Animation[]		m_BurungAnimation;
	
	public static TextureRegion[] 	m_GarudaSprite;
	public static Animation			m_GarudaAnimation;
	public static Animation			m_GarudaIdle;
	
	//Clear resource
	public static TextureRegion		m_PopupBackground;
	public static TextureRegion		m_ClearContinueButton;
	public static TextureRegion		m_ClearContinueButtonPressed;
	public static TextureRegion		m_ClearMenuButton;
	public static TextureRegion		m_ClearMenuButtonPressed;
	public static TextureRegion		m_ClearRetryButton;
	public static TextureRegion		m_ClearRetryButtonPressed;
	
	//Pause resource
	public static TextureRegion		m_PauseContinueButton;
	public static TextureRegion		m_PauseContinueButtonPressed;
	public static TextureRegion		m_PauseMenuButton;
	public static TextureRegion		m_PauseMenuButtonPressed;
	public static TextureRegion		m_PauseRetryButton;
	public static TextureRegion		m_PauseRetryButtonPressed;
	
	//Load Resource
	public static void Load() {
		//Load texture
		String m_Texture 		= Constants.GAME_TEXTURE_FOLDER + "texture-full.png";
		Texture m_SpriteSheet 	= new Texture(Gdx.files.internal(m_Texture));
		
		//Load splash resource
        m_Splash = new TextureRegion(m_SpriteSheet,3006, 2540, Constants.GAME_WIDTH, Constants.GAME_HEIGHT);
		
		//Load menu resource
		m_MenuBackground 		= new TextureRegion(m_SpriteSheet, 1920, 3369, Constants.GAME_WIDTH, Constants.GAME_HEIGHT);
		m_MenuTitle 			= new TextureRegion(m_SpriteSheet, 1440, 3168, Constants.MENU_TITLE_WIDTH, Constants.MENU_TITLE_HEIGHT);
		m_MenuPlay 				= new TextureRegion(m_SpriteSheet, 1440, 3270, Constants.MENU_PLAY_WIDTH, Constants.MENU_PLAY_HEIGHT);
		m_MenuPlayPressed 		= new TextureRegion(m_SpriteSheet, 1568, 3270, Constants.MENU_PLAY_WIDTH, Constants.MENU_PLAY_HEIGHT);
		m_MenuFreePlay 			= new TextureRegion(m_SpriteSheet, 1815, 3157, 120, 56);
		m_MenuFreePlayPressed 	= new TextureRegion(m_SpriteSheet, 1815, 3214, 120, 56);
		m_MenuCredits 			= new TextureRegion(m_SpriteSheet, 1698, 3270, 118, 55);
		m_MenuCreditsPressed 	= new TextureRegion(m_SpriteSheet, 1815, 3270, 118, 55);
		m_MenuSound 			= new TextureRegion(m_SpriteSheet, 1440, 3332, Constants.MENU_SOUND_WIDTH, Constants.MENU_SOUND_HEIGHT);
		m_MenuSoundPressed 		= new TextureRegion(m_SpriteSheet, 1476, 3332, Constants.MENU_SOUND_WIDTH, Constants.MENU_SOUND_HEIGHT);

		//Load map resource
		m_MapBackground = new TextureRegion(m_SpriteSheet, 0, 3689, Constants.GAME_WIDTH, Constants.GAME_HEIGHT);
		
		m_Sulawesi 			= new TextureRegion(m_SpriteSheet, 480, 3689, Constants.MAP_PLACES_WIDTH, Constants.MAP_PLACES_HEIGHT);
		m_Jawa 				= new TextureRegion(m_SpriteSheet, 572, 3689, Constants.MAP_PLACES_WIDTH, Constants.MAP_PLACES_HEIGHT);
		m_Sumatera 			= new TextureRegion(m_SpriteSheet, 664, 3689, Constants.MAP_PLACES_WIDTH, Constants.MAP_PLACES_HEIGHT);
		m_Kalimantan 		= new TextureRegion(m_SpriteSheet, 756, 3689, Constants.MAP_PLACES_WIDTH, Constants.MAP_PLACES_HEIGHT);
		m_SulawesiInfo 		= new TextureRegion(m_SpriteSheet, 479, 3763, Constants.MAP_INFO_WIDTH, Constants.MAP_INFO_HEIGHT);
		m_JawaInfo 			= new TextureRegion(m_SpriteSheet, 587, 3763, Constants.MAP_INFO_WIDTH, Constants.MAP_INFO_HEIGHT);
		m_SumateraInfo 		= new TextureRegion(m_SpriteSheet, 695, 3763, Constants.MAP_INFO_WIDTH, Constants.MAP_INFO_HEIGHT);
		m_KalimantanInfo 	= new TextureRegion(m_SpriteSheet, 805, 3763, Constants.MAP_INFO_WIDTH, Constants.MAP_INFO_HEIGHT);
		
		m_SulawesiButton 	= new TextureRegion(m_SpriteSheet, 2800, 2811, Constants.MAP_BUTTON_WIDTH, Constants.MAP_BUTTON_HEIGHT);
		m_JawaButton 		= new TextureRegion(m_SpriteSheet, 2852, 2811, Constants.MAP_BUTTON_WIDTH, Constants.MAP_BUTTON_HEIGHT);
		m_SumateraButton 	= new TextureRegion(m_SpriteSheet, 2901, 2811, Constants.MAP_BUTTON_WIDTH, Constants.MAP_BUTTON_HEIGHT);
		m_KalimantanButton 	= new TextureRegion(m_SpriteSheet, 2951, 2811, Constants.MAP_BUTTON_WIDTH, Constants.MAP_BUTTON_HEIGHT);
		
		//Load scene resource
		vn_Textbox 				= new TextureRegion(m_SpriteSheet, 1442,3002,462,133);
		vn_AiraBiasa 			= new TextureRegion(m_SpriteSheet, 2801,0,190,288);
		vn_AiraSedih 			= new TextureRegion(m_SpriteSheet, 2990,0,192,288);
		vn_AiraSenang 			= new TextureRegion(m_SpriteSheet, 3182,0,192,288);
		vn_Ambordeva 			= new TextureRegion(m_SpriteSheet, 3386,0,406,288);
		vn_AyahGaruda 			= new TextureRegion(m_SpriteSheet, 2801,288,200,234);
		vn_DayangSumbiBiasa 	= new TextureRegion(m_SpriteSheet, 3000,288,146,258);
		vn_Gardana 				= new TextureRegion(m_SpriteSheet, 3147,288,184,234);
		vn_GarudaBiasa 			= new TextureRegion(m_SpriteSheet, 3367,288,129,233);
		vn_GarudaBingung 		= new TextureRegion(m_SpriteSheet, 3497,288,165,234);
		vn_GarudaSedih 			= new TextureRegion(m_SpriteSheet, 3662,289,165,234);
		vn_GarudaSenang 		= new TextureRegion(m_SpriteSheet, 3827,289,165,234);
		vn_GatotKacaBiasa 		= new TextureRegion(m_SpriteSheet, 2801,546,222,268);
		vn_GatotKacaSenang 		= new TextureRegion(m_SpriteSheet, 3023,546,213,268);
		vn_HanomanBiasa 		= new TextureRegion(m_SpriteSheet, 3238,546,192,256);
		vn_HanomanSenang 		= new TextureRegion(m_SpriteSheet, 3430,546,192,256);
		vn_Petapa 				= new TextureRegion(m_SpriteSheet, 3804,55,157,233);
		vn_ShintaBiasa 			= new TextureRegion(m_SpriteSheet, 3621,546,142,256);
		vn_Srikandi 			= new TextureRegion(m_SpriteSheet, 3794,546,167,265);
		
		vn_Backgrounds = new TextureRegion[5];
		vn_Backgrounds[Constants.GAME_PLACE_PROLOG] 	= new TextureRegion(m_SpriteSheet, 480, 3369, 480,320);
		vn_Backgrounds[Constants.GAME_PLACE_PRAMBANAN] 	= new TextureRegion(m_SpriteSheet, 1920, 3369, 480,320);
		vn_Backgrounds[Constants.GAME_PLACE_BORNEO] 	= new TextureRegion(m_SpriteSheet, 960, 3369, 480,320);
		vn_Backgrounds[Constants.GAME_PLACE_BUNAKEN] 	= new TextureRegion(m_SpriteSheet, 1440, 3369, 480,320);
		vn_Backgrounds[Constants.GAME_PLACE_TOBA] 		= new TextureRegion(m_SpriteSheet, 0, 3369, 480,320);
		
		//Load game resource
		m_GameBackgrounds = new TextureRegion[Constants.GAME_BACKGROUND_NUMBER];
		
		m_GameBackgrounds[Constants.GAME_PLACE_PROLOG] 		= new TextureRegion(m_SpriteSheet, 0 , 0, 2802, 598);
		m_GameBackgrounds[Constants.GAME_PLACE_BORNEO] 		= new TextureRegion(m_SpriteSheet, 0 , 598, 2800, 600);
		m_GameBackgrounds[Constants.GAME_PLACE_BUNAKEN] 	= new TextureRegion(m_SpriteSheet, 0 , 1198, 2802, 601);
		m_GameBackgrounds[Constants.GAME_PLACE_PRAMBANAN] 	= new TextureRegion(m_SpriteSheet, 0 , 1799, 2800, 600);
		m_GameBackgrounds[Constants.GAME_PLACE_TOBA] 		= new TextureRegion(m_SpriteSheet, 0 , 2399, 2800, 601);

		m_GameBackgroundFloors = new TextureRegion[Constants.GAME_BACKGROUND_NUMBER];
		
		m_GameBackgroundFloors[Constants.GAME_PLACE_PROLOG] 	= new TextureRegion(m_SpriteSheet, 0 , 3008, 1440, 84);
		m_GameBackgroundFloors[Constants.GAME_PLACE_BORNEO] 	= new TextureRegion(m_SpriteSheet, 0 , 3092, 1440, 54);
		m_GameBackgroundFloors[Constants.GAME_PLACE_PRAMBANAN] 	= new TextureRegion(m_SpriteSheet, 0 , 3146, 1440, 68);
		m_GameBackgroundFloors[Constants.GAME_PLACE_TOBA] 		= new TextureRegion(m_SpriteSheet, 0 , 3214, 1440, 70);
		m_GameBackgroundFloors[Constants.GAME_PLACE_BUNAKEN] 	= new TextureRegion(m_SpriteSheet, 0 , 3286, 1440, 82);
		
		m_GameWindButton 		= new TextureRegion(m_SpriteSheet, 2451, 3322, 39, 39);
		m_GameGatotkacaButton 	= new TextureRegion(m_SpriteSheet, 2400, 3322, 52, 39);
		m_GameWandButton 		= new TextureRegion(m_SpriteSheet, 2490, 3322, 44, 39);
		m_GameWarpButton 		= new TextureRegion(m_SpriteSheet, 2538, 3322, 43, 39);
		
		m_AiraSprite 		= new TextureRegion(m_SpriteSheet, 3709, 802, 65, 123);
		m_ButoSprite 		= new TextureRegion(m_SpriteSheet, 3774, 811, 226, 137);
		m_GardanaSprite 	= new TextureRegion(m_SpriteSheet, 2800, 924, 104, 141);
		m_GardapatiSprite 	= new TextureRegion(m_SpriteSheet, 2917, 924, 128, 171);
		m_GatotKacaSprite 	= new TextureRegion(m_SpriteSheet, 3045, 924, 66, 134);
		m_GaluvastraSprite 	= new TextureRegion(m_SpriteSheet, 3176, 924, 57, 134);
		m_HanomanSprite 	= new TextureRegion(m_SpriteSheet, 3111, 924, 65, 134);
		m_3DewiSprite 		= new TextureRegion(m_SpriteSheet, 3233, 924, 134, 134);
		
		m_LumpingSprite = new TextureRegion[Constants.ENCOUNTER_SPRITES_NUM];
		
		m_LumpingSprite[Encounter.COLOR_RED] 	= new TextureRegion(m_SpriteSheet, 2802, 1525, 91, 120);
		m_LumpingSprite[Encounter.COLOR_GREEN] 	= new TextureRegion(m_SpriteSheet, 2893, 1525, 91, 120);
		m_LumpingSprite[Encounter.COLOR_BLUE] 	= new TextureRegion(m_SpriteSheet, 2896, 1525, 91, 120);
		m_LumpingSprite[Encounter.COLOR_YELLOW] = new TextureRegion(m_SpriteSheet, 3078, 1525, 91, 120);
		
		m_LandakSprite = new TextureRegion[Constants.ENCOUNTER_SPRITES_NUM];
		
		m_LandakSprite[Encounter.COLOR_BLUE] 	= new TextureRegion(m_SpriteSheet, 3186, 1502, 150, 143);
		m_LandakSprite[Encounter.COLOR_RED] 	= new TextureRegion(m_SpriteSheet, 3353, 1502, 150, 143);
		m_LandakSprite[Encounter.COLOR_YELLOW] 	= new TextureRegion(m_SpriteSheet, 3519, 1502, 150, 143);
		m_LandakSprite[Encounter.COLOR_GREEN] 	= new TextureRegion(m_SpriteSheet, 3686, 1502, 150, 143);
		
		m_StupaSprite = new TextureRegion[Constants.ENCOUNTER_SPRITES_NUM];
		m_StupaSprite[Encounter.COLOR_YELLOW] 	= new TextureRegion(m_SpriteSheet, 2804, 1651, 129, 175);
		m_StupaSprite[Encounter.COLOR_RED] 		= new TextureRegion(m_SpriteSheet, 2936, 1651, 123, 175);
		m_StupaSprite[Encounter.COLOR_GREEN] 	= new TextureRegion(m_SpriteSheet, 3060, 1651, 129, 175);
		m_StupaSprite[Encounter.COLOR_BLUE] 	= new TextureRegion(m_SpriteSheet, 3188, 1651, 129, 175);
		
		m_BungaSprite = new TextureRegion[Constants.ENCOUNTER_SPRITES_NUM][Constants.ENCOUNTER_BUNGA_FRAME];
		
		m_BungaSprite[Encounter.COLOR_YELLOW][0] = new TextureRegion(m_SpriteSheet, 2804, 1826, 129, 108);
		m_BungaSprite[Encounter.COLOR_YELLOW][1] = new TextureRegion(m_SpriteSheet, 2936, 1826, 129, 108);
		m_BungaSprite[Encounter.COLOR_YELLOW][2] = new TextureRegion(m_SpriteSheet, 3060, 1826, 129, 108);
		m_BungaSprite[Encounter.COLOR_YELLOW][3] = new TextureRegion(m_SpriteSheet, 3188, 1826, 129, 108);
		
		m_BungaSprite[Encounter.COLOR_GREEN][0] = new TextureRegion(m_SpriteSheet, 3352, 1826, 131, 108);
		m_BungaSprite[Encounter.COLOR_GREEN][1] = new TextureRegion(m_SpriteSheet, 3483, 1826, 131, 108);
		m_BungaSprite[Encounter.COLOR_GREEN][2] = new TextureRegion(m_SpriteSheet, 3613, 1826, 131, 108);
		m_BungaSprite[Encounter.COLOR_GREEN][3] = new TextureRegion(m_SpriteSheet, 3742, 1826, 131, 108);
		
		m_BungaSprite[Encounter.COLOR_BLUE][0] = new TextureRegion(m_SpriteSheet, 2802, 1940, 129, 88);
		m_BungaSprite[Encounter.COLOR_BLUE][1] = new TextureRegion(m_SpriteSheet, 2931, 1940, 129, 88);
		m_BungaSprite[Encounter.COLOR_BLUE][2] = new TextureRegion(m_SpriteSheet, 3060, 1940, 129, 88);
		m_BungaSprite[Encounter.COLOR_BLUE][3] = new TextureRegion(m_SpriteSheet, 3189, 1940, 129, 88);
		
		m_BungaSprite[Encounter.COLOR_RED][0] = new TextureRegion(m_SpriteSheet, 3352, 1940, 131, 88);
		m_BungaSprite[Encounter.COLOR_RED][1] = new TextureRegion(m_SpriteSheet, 3483, 1940, 131, 88);
		m_BungaSprite[Encounter.COLOR_RED][2] = new TextureRegion(m_SpriteSheet, 3613, 1940, 131, 88);
		m_BungaSprite[Encounter.COLOR_RED][3] = new TextureRegion(m_SpriteSheet, 3742, 1940, 131, 88);
		
		m_BurungSprite = new TextureRegion[Constants.ENCOUNTER_SPRITES_NUM][Constants.ENCOUNTER_BURUNG_FRAME];
		
		m_BurungSprite[Encounter.COLOR_BLUE][0] = new TextureRegion(m_SpriteSheet, 2808, 2030, 109, 122);
		m_BurungSprite[Encounter.COLOR_BLUE][1] = new TextureRegion(m_SpriteSheet, 2917, 2030, 109, 122);
		m_BurungSprite[Encounter.COLOR_BLUE][2] = new TextureRegion(m_SpriteSheet, 3026, 2030, 109, 122);
		m_BurungSprite[Encounter.COLOR_BLUE][3] = new TextureRegion(m_SpriteSheet, 3135, 2030, 109, 122);
		m_BurungSprite[Encounter.COLOR_BLUE][4] = new TextureRegion(m_SpriteSheet, 3244, 2030, 109, 122);
		m_BurungSprite[Encounter.COLOR_BLUE][5] = new TextureRegion(m_SpriteSheet, 3352, 2030, 109, 122);
		m_BurungSprite[Encounter.COLOR_BLUE][6] = new TextureRegion(m_SpriteSheet, 3460, 2030, 109, 122);
		
		m_BurungSprite[Encounter.COLOR_RED][0] = new TextureRegion(m_SpriteSheet, 2808, 2281, 109, 122);
		m_BurungSprite[Encounter.COLOR_RED][1] = new TextureRegion(m_SpriteSheet, 2917, 2281, 109, 122);
		m_BurungSprite[Encounter.COLOR_RED][2] = new TextureRegion(m_SpriteSheet, 3026, 2281, 109, 122);
		m_BurungSprite[Encounter.COLOR_RED][3] = new TextureRegion(m_SpriteSheet, 3135, 2281, 109, 122);
		m_BurungSprite[Encounter.COLOR_RED][4] = new TextureRegion(m_SpriteSheet, 3244, 2281, 109, 122);
		m_BurungSprite[Encounter.COLOR_RED][5] = new TextureRegion(m_SpriteSheet, 3352, 2281, 109, 122);
		m_BurungSprite[Encounter.COLOR_RED][6] = new TextureRegion(m_SpriteSheet, 3460, 2281, 109, 122);
		
		m_BurungSprite[Encounter.COLOR_GREEN][0] = new TextureRegion(m_SpriteSheet, 2808, 2156, 109, 122);
		m_BurungSprite[Encounter.COLOR_GREEN][1] = new TextureRegion(m_SpriteSheet, 2917, 2156, 109, 122);
		m_BurungSprite[Encounter.COLOR_GREEN][2] = new TextureRegion(m_SpriteSheet, 3026, 2156, 109, 122);
		m_BurungSprite[Encounter.COLOR_GREEN][3] = new TextureRegion(m_SpriteSheet, 3135, 2156, 109, 122);
		m_BurungSprite[Encounter.COLOR_GREEN][4] = new TextureRegion(m_SpriteSheet, 3244, 2156, 109, 122);
		m_BurungSprite[Encounter.COLOR_GREEN][5] = new TextureRegion(m_SpriteSheet, 3352, 2156, 109, 122);
		m_BurungSprite[Encounter.COLOR_GREEN][6] = new TextureRegion(m_SpriteSheet, 3460, 2156, 109, 122);
		
		m_BurungSprite[Encounter.COLOR_YELLOW][0] = new TextureRegion(m_SpriteSheet, 2808, 2406, 109, 122);
		m_BurungSprite[Encounter.COLOR_YELLOW][1] = new TextureRegion(m_SpriteSheet, 2917, 2406, 109, 122);
		m_BurungSprite[Encounter.COLOR_YELLOW][2] = new TextureRegion(m_SpriteSheet, 3026, 2406, 109, 122);
		m_BurungSprite[Encounter.COLOR_YELLOW][3] = new TextureRegion(m_SpriteSheet, 3135, 2406, 109, 122);
		m_BurungSprite[Encounter.COLOR_YELLOW][4] = new TextureRegion(m_SpriteSheet, 3244, 2406, 109, 122);
		m_BurungSprite[Encounter.COLOR_YELLOW][5] = new TextureRegion(m_SpriteSheet, 3352, 2406, 109, 122);
		m_BurungSprite[Encounter.COLOR_YELLOW][6] = new TextureRegion(m_SpriteSheet, 3460, 2406, 109, 122);
		
		//Flip all birds
		for (int i=0;i<Constants.ENCOUNTER_SPRITES_NUM;i++) {
			for (int j=0;j<Constants.ENCOUNTER_BURUNG_FRAME;j++) {
				m_BurungSprite[i][j].flip(true, false);
			}
		}
		
		m_BungaAnimation = new Animation[Constants.ENCOUNTER_SPRITES_NUM];
		
		m_BungaAnimation[Encounter.COLOR_YELLOW] = new Animation(1.0f/6.0f, 
				m_BungaSprite[Encounter.COLOR_YELLOW][0],m_BungaSprite[Encounter.COLOR_YELLOW][1],
				m_BungaSprite[Encounter.COLOR_YELLOW][2],m_BungaSprite[Encounter.COLOR_YELLOW][3],
				m_BungaSprite[Encounter.COLOR_YELLOW][2],m_BungaSprite[Encounter.COLOR_YELLOW][1],
				m_BungaSprite[Encounter.COLOR_YELLOW][0]);
		
		m_BungaAnimation[Encounter.COLOR_GREEN] = new Animation(1.0f/6.0f, 
				m_BungaSprite[Encounter.COLOR_GREEN][0],m_BungaSprite[Encounter.COLOR_GREEN][1],
				m_BungaSprite[Encounter.COLOR_GREEN][2],m_BungaSprite[Encounter.COLOR_GREEN][3],
				m_BungaSprite[Encounter.COLOR_GREEN][2],m_BungaSprite[Encounter.COLOR_GREEN][1],
				m_BungaSprite[Encounter.COLOR_GREEN][0]);
		
		m_BungaAnimation[Encounter.COLOR_BLUE] = new Animation(1.0f/6.0f, 
				m_BungaSprite[Encounter.COLOR_BLUE][0],m_BungaSprite[Encounter.COLOR_BLUE][1],
				m_BungaSprite[Encounter.COLOR_BLUE][2],m_BungaSprite[Encounter.COLOR_BLUE][3],
				m_BungaSprite[Encounter.COLOR_BLUE][2],m_BungaSprite[Encounter.COLOR_BLUE][1],
				m_BungaSprite[Encounter.COLOR_BLUE][0]);
		
		m_BungaAnimation[Encounter.COLOR_RED] = new Animation(1.0f/6.0f, 
				m_BungaSprite[Encounter.COLOR_RED][0],m_BungaSprite[Encounter.COLOR_RED][1],
				m_BungaSprite[Encounter.COLOR_RED][2],m_BungaSprite[Encounter.COLOR_RED][3],
				m_BungaSprite[Encounter.COLOR_RED][2],m_BungaSprite[Encounter.COLOR_RED][1],
				m_BungaSprite[Encounter.COLOR_RED][0]);
		
		m_BurungAnimation = new Animation[Constants.ENCOUNTER_SPRITES_NUM];
		
		m_BurungAnimation[Encounter.COLOR_BLUE] = new Animation(1.0f/6.0f, 
				m_BurungSprite[Encounter.COLOR_BLUE][0],m_BurungSprite[Encounter.COLOR_BLUE][1],
				m_BurungSprite[Encounter.COLOR_BLUE][2],m_BurungSprite[Encounter.COLOR_BLUE][3],
				m_BurungSprite[Encounter.COLOR_BLUE][4],m_BurungSprite[Encounter.COLOR_BLUE][5],
				m_BurungSprite[Encounter.COLOR_BLUE][6],m_BurungSprite[Encounter.COLOR_BLUE][5],
				m_BurungSprite[Encounter.COLOR_BLUE][4],m_BurungSprite[Encounter.COLOR_BLUE][3],
				m_BurungSprite[Encounter.COLOR_BLUE][2],m_BurungSprite[Encounter.COLOR_BLUE][1],
				m_BurungSprite[Encounter.COLOR_BLUE][0]);
		
		m_BurungAnimation[Encounter.COLOR_RED] = new Animation(1.0f/6.0f, 
				m_BurungSprite[Encounter.COLOR_RED][0],m_BurungSprite[Encounter.COLOR_RED][1],
				m_BurungSprite[Encounter.COLOR_RED][2],m_BurungSprite[Encounter.COLOR_RED][3],
				m_BurungSprite[Encounter.COLOR_RED][4],m_BurungSprite[Encounter.COLOR_RED][5],
				m_BurungSprite[Encounter.COLOR_RED][6],m_BurungSprite[Encounter.COLOR_RED][5],
				m_BurungSprite[Encounter.COLOR_RED][4],m_BurungSprite[Encounter.COLOR_RED][3],
				m_BurungSprite[Encounter.COLOR_RED][2],m_BurungSprite[Encounter.COLOR_RED][1],
				m_BurungSprite[Encounter.COLOR_RED][0]);
		
		m_BurungAnimation[Encounter.COLOR_GREEN] = new Animation(1.0f/6.0f, 
				m_BurungSprite[Encounter.COLOR_GREEN][0],m_BurungSprite[Encounter.COLOR_GREEN][1],
				m_BurungSprite[Encounter.COLOR_GREEN][2],m_BurungSprite[Encounter.COLOR_GREEN][3],
				m_BurungSprite[Encounter.COLOR_GREEN][4],m_BurungSprite[Encounter.COLOR_GREEN][5],
				m_BurungSprite[Encounter.COLOR_GREEN][6],m_BurungSprite[Encounter.COLOR_GREEN][5],
				m_BurungSprite[Encounter.COLOR_GREEN][4],m_BurungSprite[Encounter.COLOR_GREEN][3],
				m_BurungSprite[Encounter.COLOR_GREEN][2],m_BurungSprite[Encounter.COLOR_GREEN][1],
				m_BurungSprite[Encounter.COLOR_GREEN][0]);
		
		m_BurungAnimation[Encounter.COLOR_YELLOW] = new Animation(1.0f/6.0f, 
				m_BurungSprite[Encounter.COLOR_YELLOW][0],m_BurungSprite[Encounter.COLOR_YELLOW][1],
				m_BurungSprite[Encounter.COLOR_YELLOW][2],m_BurungSprite[Encounter.COLOR_YELLOW][3],
				m_BurungSprite[Encounter.COLOR_YELLOW][4],m_BurungSprite[Encounter.COLOR_YELLOW][5],
				m_BurungSprite[Encounter.COLOR_YELLOW][6],m_BurungSprite[Encounter.COLOR_YELLOW][5],
				m_BurungSprite[Encounter.COLOR_YELLOW][4],m_BurungSprite[Encounter.COLOR_YELLOW][3],
				m_BurungSprite[Encounter.COLOR_YELLOW][2],m_BurungSprite[Encounter.COLOR_YELLOW][1],
				m_BurungSprite[Encounter.COLOR_YELLOW][0]);
		
		m_GarudaSprite = new TextureRegion[Constants.GAME_GARUDA_FRAME];
		
		m_GarudaSprite[0] = new TextureRegion(m_SpriteSheet, 2917, 817, 92, 107);
		m_GarudaSprite[1] = new TextureRegion(m_SpriteSheet, 3009, 817, 92, 107);
		m_GarudaSprite[2] = new TextureRegion(m_SpriteSheet, 3101, 817, 92, 107);
		m_GarudaSprite[3] = new TextureRegion(m_SpriteSheet, 3193, 817, 92, 107);
		m_GarudaSprite[4] = new TextureRegion(m_SpriteSheet, 3285, 817, 92, 107);
		m_GarudaSprite[5] = new TextureRegion(m_SpriteSheet, 3377, 817, 92, 107);
		m_GarudaSprite[6] = new TextureRegion(m_SpriteSheet, 3471, 817, 90, 107);
		m_GarudaSprite[7] = new TextureRegion(m_SpriteSheet, 3561, 817, 66, 107);
		m_GarudaSprite[8] = new TextureRegion(m_SpriteSheet, 3627, 817, 52, 107);
		
		m_GarudaAnimation 	= new Animation(1.0f/6.0f, m_GarudaSprite[0], m_GarudaSprite[1],m_GarudaSprite[2],m_GarudaSprite[3],m_GarudaSprite[4],m_GarudaSprite[5],
								m_GarudaSprite[4],m_GarudaSprite[3],m_GarudaSprite[2],m_GarudaSprite[1],m_GarudaSprite[0]);
		m_GarudaIdle 		= new Animation(1.0f/6.0f, m_GarudaSprite[0], m_GarudaSprite[1], m_GarudaSprite[2], m_GarudaSprite[1], m_GarudaSprite[0]);
		
		//Load clear resource
		m_PopupBackground				= new TextureRegion(m_SpriteSheet, 2275, 3002, 458, 323);
		
		m_ClearContinueButtonPressed	= new TextureRegion(m_SpriteSheet, 2400, 3369, 63, 61);
		m_ClearContinueButton			= new TextureRegion(m_SpriteSheet, 2463, 3369, 64, 61);
		m_ClearMenuButtonPressed		= new TextureRegion(m_SpriteSheet, 2526, 3369, 51, 61);
		m_ClearMenuButton				= new TextureRegion(m_SpriteSheet, 2577, 3369, 51, 61);
		m_ClearRetryButtonPressed		= new TextureRegion(m_SpriteSheet, 2629, 3369, 50, 61);
		m_ClearRetryButton				= new TextureRegion(m_SpriteSheet, 2679, 3369, 51, 61);
		
		//Load pause resource
		m_PauseContinueButton			= new TextureRegion(m_SpriteSheet, 1932, 3210, 160, 159);
		m_PauseContinueButtonPressed	= new TextureRegion(m_SpriteSheet, 2092, 3210, 157, 159);	
		m_PauseMenuButton				= new TextureRegion(m_SpriteSheet, 2147, 3130, 64, 68);
		m_PauseMenuButtonPressed		= new TextureRegion(m_SpriteSheet, 2211, 3130, 54, 68);
		m_PauseRetryButton				= new TextureRegion(m_SpriteSheet, 1932, 3098, 105, 100);
		m_PauseRetryButtonPressed		= new TextureRegion(m_SpriteSheet, 2037, 3098, 103, 100);
		
		//Load fonts
		LoadFonts();
	}
	
	private static void LoadFonts() {
		String m_Path = Constants.GAME_FONT_FOLDER;
		
		//Load font
		m_FontScene 	= new BitmapFont(Gdx.files.internal(m_Path + "calibri.fnt"), Gdx.files.internal(m_Path + "calibri.png"), false);
		m_FontClear 	= new BitmapFont(Gdx.files.internal(m_Path + "calibri.fnt"), Gdx.files.internal(m_Path + "calibri.png"), false);
		m_FontFailed 	= new BitmapFont(Gdx.files.internal(m_Path + "calibri.fnt"), Gdx.files.internal(m_Path + "calibri.png"), false);
		m_FontScore 	= new BitmapFont(Gdx.files.internal(m_Path + "calibri.fnt"), Gdx.files.internal(m_Path + "calibri.png"), false);
		m_FontScorePlay = new BitmapFont(Gdx.files.internal(m_Path + "calibri.fnt"), Gdx.files.internal(m_Path + "calibri.png"), false);
		
		/*
		m_FontScene 	= new BitmapFont(Gdx.files.internal(m_Path + "scene.fnt"), Gdx.files.internal(m_Path + "scene.png"), false);
		m_FontClear 	= new BitmapFont(Gdx.files.internal(m_Path + "clear.fnt"), Gdx.files.internal(m_Path + "clear.png"), false);
		m_FontFailed 	= new BitmapFont(Gdx.files.internal(m_Path + "failed.fnt"), Gdx.files.internal(m_Path + "failed.png"), false);
		m_FontScore 	= new BitmapFont(Gdx.files.internal(m_Path + "score.fnt"), Gdx.files.internal(m_Path + "score.png"), false);
		m_FontScorePlay = new BitmapFont(Gdx.files.internal(m_Path + "play.fnt"), Gdx.files.internal(m_Path + "play.png"), false);
		*/
	}
	
	public static TextureRegion GetVNFromString(String m_Name) {
		TextureRegion m_Retval = null;
		
		if (m_Name!=null) {
			//Get texture region accordingly
			if (m_Name.equals("Aira_Biasa")) {
				m_Retval = vn_AiraBiasa;
			} else if (m_Name.equals("Aira_Sedih")) {
				m_Retval = vn_AiraSedih;
			} else if (m_Name.equals("Aira_Senang")) {
				m_Retval = vn_AiraSenang;
			} else if (m_Name.equals("Ambordeva")) {
				m_Retval = vn_Ambordeva;
			} else if (m_Name.equals("Ayah_Garuda")) {
				m_Retval = vn_AyahGaruda;
			} else if (m_Name.equals("Dayang_Sumbi")) {
				m_Retval = vn_DayangSumbiBiasa;
			} else if (m_Name.equals("Gardana")) {
				m_Retval = vn_Gardana;
			} else if (m_Name.equals("Garuda_Biasa")) {
				m_Retval = vn_GarudaBiasa;
			} else if (m_Name.equals("Garuda_Bingung")) {
				m_Retval = vn_GarudaBingung;
			} else if (m_Name.equals("Garuda_Sedih")) {
				m_Retval = vn_GarudaSedih;
			} else if (m_Name.equals("Garuda_Senang")) {
				m_Retval = vn_GarudaSenang;
			} else if (m_Name.equals("Gatotkaca")) {
				m_Retval = vn_GatotKacaBiasa;
			} else if (m_Name.equals("Gatotkaca_Senang")) {
				m_Retval = vn_GatotKacaSenang;
			} else if (m_Name.equals("Hanoman")) {
				m_Retval = vn_HanomanBiasa;
			} else if (m_Name.equals("Hanoman_Senang")) {
				m_Retval = vn_HanomanSenang;
			} else if (m_Name.equals("Galuvastra")) {
				m_Retval = vn_Petapa;
			} else if (m_Name.equals("Shinta")) {
				m_Retval = vn_ShintaBiasa;
			} else if (m_Name.equals("Srikandi")) {
				m_Retval = vn_Srikandi;
			}
		}
		
		return m_Retval;
	}
	
	public static void Dispose() {
		m_FontScene.dispose();
	}
	
}
